package com.dong.demo.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.retry.annotation.Recover;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeoutException;

@Service
@Slf4j
public class RetryService {
    @Retryable
    public void callChannel() throws Exception {
        queryOrder();
    }

    @Recover
    public void channelNotResp(){
        log.info("没有获取到返回信息");
    }
    public void queryOrder() throws Exception{
//        log.info("调用了 queryOrder");
        throw new TimeoutException("超时");
    }
}
